﻿// Decompiled with JetBrains decompiler
// Type: UnityEngine.iOS.Device
// Assembly: UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E6AE6B5A-2752-4B07-9528-C8B77C62CE79
// Assembly location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.dll
// XML documentation location: C:\Users\windys\Unity\2021.3.39f1c1\Editor\Data\Managed\UnityEngine\UnityEngine.CoreModule.xml

using System.Runtime.CompilerServices;
using UnityEngine.Bindings;

#nullable disable
namespace UnityEngine.iOS
{
  /// <summary>
  ///   <para>Interface into iOS specific functionality.</para>
  /// </summary>
  [NativeHeader("PlatformDependent/iPhonePlayer/IOSScriptBindings.h")]
  public sealed class Device
  {
    /// <summary>
    ///   <para>iOS version.</para>
    /// </summary>
    public static extern string systemVersion { [NativeConditional("PLATFORM_IOS"), FreeFunction("systeminfo::GetDeviceSystemVersion"), MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>The generation of the device. (Read Only)</para>
    /// </summary>
    public static extern DeviceGeneration generation { [NativeConditional("PLATFORM_IOS"), FreeFunction("UnityDeviceGeneration"), MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Vendor ID.</para>
    /// </summary>
    public static extern string vendorIdentifier { [NativeConditional("PLATFORM_IOS || PLATFORM_TVOS"), FreeFunction("UnityVendorIdentifier"), MethodImpl(MethodImplOptions.InternalCall)] get; }

    [FreeFunction("UnityAdIdentifier")]
    [NativeConditional("PLATFORM_IOS || PLATFORM_TVOS")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern string GetAdIdentifier();

    /// <summary>
    ///   <para>Advertising ID.</para>
    /// </summary>
    public static string advertisingIdentifier
    {
      get
      {
        string adIdentifier = Device.GetAdIdentifier();
        Application.InvokeOnAdvertisingIdentifierCallback(adIdentifier, Device.IsAdTrackingEnabled());
        return adIdentifier;
      }
    }

    [FreeFunction("IOSScripting::IsAdTrackingEnabled")]
    [NativeConditional("PLATFORM_IOS || PLATFORM_TVOS")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    private static extern bool IsAdTrackingEnabled();

    /// <summary>
    ///   <para>Is advertising tracking enabled.</para>
    /// </summary>
    public static bool advertisingTrackingEnabled => Device.IsAdTrackingEnabled();

    /// <summary>
    ///   <para>Specifies whether the home button should be hidden in the iOS build of this application.</para>
    /// </summary>
    public static extern bool hideHomeButton { [FreeFunction("IOSScripting::GetHideHomeButton"), NativeConditional("PLATFORM_IOS"), MethodImpl(MethodImplOptions.InternalCall)] get; [FreeFunction("IOSScripting::SetHideHomeButton"), NativeConditional("PLATFORM_IOS"), MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Indicates whether Low Power Mode is enabled on the device.</para>
    /// </summary>
    public static extern bool lowPowerModeEnabled { [FreeFunction("IOSScripting::GetLowPowerModeEnabled"), NativeConditional("PLATFORM_IOS"), MethodImpl(MethodImplOptions.InternalCall)] get; }

    /// <summary>
    ///   <para>Indicates whether the screen may be dimmed lower than the hardware is normally capable of by emulating it in software.</para>
    /// </summary>
    public static extern bool wantsSoftwareDimming { [FreeFunction("IOSScripting::GetWantsSoftwareDimming"), NativeConditional("PLATFORM_IOS"), MethodImpl(MethodImplOptions.InternalCall)] get; [NativeConditional("PLATFORM_IOS"), FreeFunction("IOSScripting::SetWantsSoftwareDimming"), MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Specifies whether app built for iOS is running on Mac.</para>
    /// </summary>
    public static extern bool iosAppOnMac { [NativeConditional("PLATFORM_IOS"), FreeFunction("IOSScripting::GetIosAppOnMac"), MethodImpl(MethodImplOptions.InternalCall)] get; }

    private static extern int deferSystemGesturesModeInternal { [NativeConditional("PLATFORM_IOS"), FreeFunction("IOSScripting::GetDeferSystemGesturesMode"), MethodImpl(MethodImplOptions.InternalCall)] get; [NativeConditional("PLATFORM_IOS"), FreeFunction("IOSScripting::SetDeferSystemGesturesMode"), MethodImpl(MethodImplOptions.InternalCall)] set; }

    /// <summary>
    ///   <para>Defer system gestures until the second swipe on specific edges.</para>
    /// </summary>
    public static SystemGestureDeferMode deferSystemGesturesMode
    {
      get => (SystemGestureDeferMode) Device.deferSystemGesturesModeInternal;
      set => Device.deferSystemGesturesModeInternal = (int) value;
    }

    /// <summary>
    ///   <para>Set file flag to be excluded from iCloud/iTunes backup.</para>
    /// </summary>
    /// <param name="path"></param>
    [NativeMethod(Name = "IOSScripting::SetNoBackupFlag", IsFreeFunction = true, IsThreadSafe = true)]
    [NativeConditional("PLATFORM_IOS || PLATFORM_TVOS")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void SetNoBackupFlag(string path);

    /// <summary>
    ///   <para>Reset "no backup" file flag: file will be synced with iCloud/iTunes backup and can be deleted by OS in low storage situations.</para>
    /// </summary>
    /// <param name="path"></param>
    [NativeMethod(Name = "IOSScripting::ResetNoBackupFlag", IsFreeFunction = true, IsThreadSafe = true)]
    [NativeConditional("PLATFORM_IOS || PLATFORM_TVOS")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern void ResetNoBackupFlag(string path);

    /// <summary>
    ///   <para>Request App Store rating and review from the user.</para>
    /// </summary>
    /// <returns>
    ///   <para>Value indicating whether the underlying API is available or not. False indicates that the iOS version isn't recent enough or that the StoreKit framework is not linked with the app.</para>
    /// </returns>
    [NativeMethod(Name = "IOSScripting::RequestStoreReview", IsFreeFunction = true, IsThreadSafe = true)]
    [NativeConditional("PLATFORM_IOS")]
    [MethodImpl(MethodImplOptions.InternalCall)]
    public static extern bool RequestStoreReview();
  }
}
